﻿using RuoVea.ExSugar.Attributes;

namespace RuoVea.OmiApi.UserRoleMenu.Entitys;

/// <summary>
/// 用户角色表
/// </summary>
[SugarTable(nameof(SysUserRole), "用户角色表")]
[Description("用户角色表")]
[Tenant("0")]
public class SysUserRole : EntityBaseId
{
    /// <summary>
    /// 用户Id
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(UserId), columnDescription:"用户Id")]
    public long UserId { get; set; }

    /// <summary>
    /// 用户
    /// </summary>
    [Newtonsoft.Json.JsonIgnore]
    [System.Text.Json.Serialization.JsonIgnore]
    [Navigate(NavigateType.OneToOne, nameof(UserId))]
    public SysUser SysUser { get; set; }

    /// <summary>
    /// 系统角色Id
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(RoleId), columnDescription:"角色Id")]
    public long RoleId { get; set; }

    /// <summary>
    /// 角色
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(RoleId))]
    public SysRole SysRole { get; set; }
}


